//
//  LaunchViewController.m
//  VTravel
//
//  Created by lanouhn on 16/8/1.
//  Copyright © 2016年 xiaoYu. All rights reserved.
//

#import "LaunchViewController.h"

@interface LaunchViewController ()

@end

@implementation LaunchViewController

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:YES];
    // 因为视图执行viewdidLoad的时候,控件不一定加载到当前的视图上,这时如果给控件添加动画会出现问题,所以我们等视图已经出现的时候,也就是控件已经加载到视图上时,再添加动画
    [UIView animateWithDuration:0.5 animations:^{
        // 修改frame
        self.birdImageView.frame = CGRectMake(self.birdImageView.frame.origin.x, self.birdImageView.frame.origin.y - 100, self.birdImageView.frame.size.width, self.birdImageView.frame.size.height);
        self.label.frame = CGRectMake(self.label.frame.origin.x, self.label.frame.origin.y + 100, self.label.frame.size.width, self.label.frame.size.height);
        
    } completion:^(BOOL finished) {
        
        // 启动动画结束的时候加载TabBarController控制器
        // 找到MainstoryBoard
        UIStoryboard *mainSty = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
        // 找到当前应用程序的storyBoard中的TabBarController,并将他设置为window的根视图
        UITabBarController *tabBarController = [mainSty instantiateViewControllerWithIdentifier:@"TabBarController"];
        UIWindow *window = [UIApplication sharedApplication].keyWindow;
        [window setRootViewController:tabBarController];
        
    }];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
